/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bc;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author DEAPP
 */
@Entity
@Table(name = "cronograma_pagos_alumno")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CronogramaPagosAlumno.findAll", query = "SELECT c FROM CronogramaPagosAlumno c"),
    @NamedQuery(name = "CronogramaPagosAlumno.findByIdCronogramaPagosAlumno", query = "SELECT c FROM CronogramaPagosAlumno c WHERE c.idCronogramaPagosAlumno = :idCronogramaPagosAlumno"),
    @NamedQuery(name = "CronogramaPagosAlumno.findByNumeroPension", query = "SELECT c FROM CronogramaPagosAlumno c WHERE c.numeroPension = :numeroPension"),
    @NamedQuery(name = "CronogramaPagosAlumno.findByNumeroMes", query = "SELECT c FROM CronogramaPagosAlumno c WHERE c.numeroMes = :numeroMes"),
    @NamedQuery(name = "CronogramaPagosAlumno.findByMontoPension", query = "SELECT c FROM CronogramaPagosAlumno c WHERE c.montoPension = :montoPension"),
    @NamedQuery(name = "CronogramaPagosAlumno.findByEstadoExistencia", query = "SELECT c FROM CronogramaPagosAlumno c WHERE c.estadoExistencia = :estadoExistencia")})
public class CronogramaPagosAlumno implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_cronograma_pagos_alumno")
    private Integer idCronogramaPagosAlumno;
    @Basic(optional = false)
    @NotNull
    @Column(name = "numero_pension")
    private int numeroPension;
    @Basic(optional = false)
    @NotNull
    @Column(name = "numero_mes")
    private int numeroMes;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "monto_pension")
    private BigDecimal montoPension;
    @Column(name = "estadoExistencia")
    private Integer estadoExistencia;
    @JoinColumn(name = "id_matricula", referencedColumnName = "id_matricula")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Matricula matricula;
    @JoinColumn(name = "id_alumno", referencedColumnName = "id_alumno")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Alumno alumno;

    public CronogramaPagosAlumno() {
    }

    public CronogramaPagosAlumno(Integer idCronogramaPagosAlumno) {
        this.idCronogramaPagosAlumno = idCronogramaPagosAlumno;
    }

    public CronogramaPagosAlumno(Integer idCronogramaPagosAlumno, int numeroPension, int numeroMes) {
        this.idCronogramaPagosAlumno = idCronogramaPagosAlumno;
        this.numeroPension = numeroPension;
        this.numeroMes = numeroMes;
    }

    public Integer getIdCronogramaPagosAlumno() {
        return idCronogramaPagosAlumno;
    }

    public void setIdCronogramaPagosAlumno(Integer idCronogramaPagosAlumno) {
        this.idCronogramaPagosAlumno = idCronogramaPagosAlumno;
    }

    public int getNumeroPension() {
        return numeroPension;
    }

    public void setNumeroPension(int numeroPension) {
        this.numeroPension = numeroPension;
    }

    public int getNumeroMes() {
        return numeroMes;
    }

    public void setNumeroMes(int numeroMes) {
        this.numeroMes = numeroMes;
    }

    public BigDecimal getMontoPension() {
        return montoPension;
    }

    public void setMontoPension(BigDecimal montoPension) {
        this.montoPension = montoPension;
    }

    public Integer getEstadoExistencia() {
        return estadoExistencia;
    }

    public void setEstadoExistencia(Integer estadoExistencia) {
        this.estadoExistencia = estadoExistencia;
    }

    public Matricula getMatricula() {
        return matricula;
    }

    public void setMatricula(Matricula matricula) {
        this.matricula = matricula;
    }

    public Alumno getAlumno() {
        return alumno;
    }

    public void setAlumno(Alumno alumno) {
        this.alumno = alumno;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCronogramaPagosAlumno != null ? idCronogramaPagosAlumno.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CronogramaPagosAlumno)) {
            return false;
        }
        CronogramaPagosAlumno other = (CronogramaPagosAlumno) object;
        if ((this.idCronogramaPagosAlumno == null && other.idCronogramaPagosAlumno != null) || (this.idCronogramaPagosAlumno != null && !this.idCronogramaPagosAlumno.equals(other.idCronogramaPagosAlumno))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bc.CronogramaPagosAlumno[ idCronogramaPagosAlumno=" + idCronogramaPagosAlumno + " ]";
    }
    
}
